package com.example.lijinyuan.baseandroid.Service;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.example.lijinyuan.baseandroid.R;

/**
 * Created by lijinyuan on 15/11/28.
 */
public class StartService extends Activity {
    Button start, stop, play, pause, next, last;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.service_my_service);

        start = (Button) findViewById(R.id.start_service);
        stop = (Button) findViewById(R.id.stop_service);
        start.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                startService(new Intent(StartService.this, ToStartService.class));
            }
        });
        stop.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                stopService(new Intent(StartService.this, ToStartService.class));

            }
        });

        play = (Button) findViewById(R.id.play);
        pause = (Button) findViewById(R.id.pause);
        next = (Button) findViewById(R.id.next);
        last = (Button) findViewById(R.id.pervious);

        play.setVisibility(View.GONE);
        pause.setVisibility(View.GONE);
        next.setVisibility(View.GONE);
        last.setVisibility(View.GONE);
    }
}
